import { createRouter, createWebHistory } from 'vue-router'

import zhuceView from '@/views/zhuce/index.vue'
import loginView from '@/views/login/index.vue'
import xiangqingView from '@/views/xiangqing/index.vue'
import goodsView from '@/views/goods/index.vue'
import homeView from '@/views/hone/home.vue'
import fenView from '@/views/hone/fen.vue'
import indexView from '@/views/hone/index.vue'
import cartView from '@/views/hone/cart.vue'
import myView from '@/views/hone/my.vue'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/zhuce',
      component: zhuceView,
    },
    {
      path: '/login',
      component: loginView,
    },
    {
      path: '/goods/:cat_name',
      component: goodsView,
    },
    {
      path: '/xiangqing/:goods_id',
      component: xiangqingView,
    },
    {
      path: '/home',
      component: homeView,
      children: [
        {
          path: 'fen',
          component: fenView,
        },
        {
          path: 'cart',
          component: cartView,
        },
        {
          path: 'index',
          component: indexView,
        },
        {
          path: 'my',
          component: myView,
        },
      ]
    },
  ],
})

export default router
